const template = `
	<div class="patrol-list">
		<van-nav-bar
			:title="title"
			@click-left="onBack"
			left-arrow
		/>
		<div class="patrol-list__inner">
			<ul>
				<li v-for="(item,index) in list" :key="index" class="patrol-list-item">
					<div>
						<span class="timePeriod">{{ '巡检班次【' + item.timePeriod + '】'}}</span>
					</div>
					<div class="patrol-list-item__avatar">
						<img src="./assets/plugins/vant/theme/default/img/avatar.png" />
					</div>
					<div class="patrol-list-item__inner">
						<div style="flex: 1;">
							<div class="patrol-list-item__name">{{ item.createName }}</div>
							<div class="patrol-list-item__datetime">
									<time>{{ item.createDate }}</time>
							</div>
						</div>
						<div style="width: 120px;">
							<div class="patrol-list-item__state is-ok">状态:&nbsp;<em>{{ item.state }}</em></div>
							<div class="patrol-list-item__total-time is-ok">用时:&nbsp;<time>{{ item.totalTime }}</time></div>
						</div>
					</div>
					<div>
						<ul class="patrol-list-item__room-wrapper">
							<li v-for="(room,roomIndex) in item.roomList" :key="roomIndex">
								<a @click="toRoom(room.id, room.name)" class="patrol-list-item__room" :class="{ finished: room.finished }">
									{{ room.name }}
								</a>
							</li>
						</ul>
					</div>
				</li>
			</ul>
			
		</div>
	</div>
`;

export default {
	created() {
		// console.log(this.$root)
		// axios.get(`/patrolRecordMs/getMyOverTaskList/${this.$root.userId}/${this.$root.nickName}`).then(resp => {
		// 	if(resp.status === 200) {
		// 		this.list = resp.data.reduce((accu,v)=> {
		// 			accu.push({
		// 				id: v.id,
		// 				text: v.timePeriod,
		// 				finished: v.stateThisDay === '1', // 0未巡检，1已巡检
		// 			});
		// 			return accu;
		// 		}, []);
		// 	}
		// });
	},
	
	data() {
		return {
			title: '历史巡检',
			list: [],
		}
	},
	methods: {
		
		
		onBack() {
			this.$router.go(-1)
		},
	},
	
	template,
	
	components: {
		
	}
}